//
//  QDMetroErrorHeaderView.h
//  QDMetroClient
//
//  Created by YueWen on 2018/12/28.
//  Copyright © 2018 YueWen. All rights reserved.
//

#import "QDMetroBaseHeaderView.h"
#import "QDMetroHeaderErrorType.h"

NS_ASSUME_NONNULL_BEGIN

@class QDMetroErrorHeaderView;

/// 代理方法
@protocol QDMetroErrorHeaderViewDelegate <NSObject>

/// QDMetroErrorHeaderView.handerButton 点击进行的回调
- (void)qdMetroErrorHeaderView:(QDMetroErrorHeaderView *)headerView
            handerButtonDidTap:(QDMetroHeaderErrorType)errorType;

@end


/// 放置乘车以及出站二维码出错的headerView
@interface QDMetroErrorHeaderView : QDMetroBaseHeaderView

/// 记录当前的错误类型
@property (nonatomic, assign, readonly)QDMetroHeaderErrorType errorType;
/// 显示图片的视图
@property (nonatomic, strong) UIImageView *imageView;
/// 显示原因的标签，ex: 未开启蓝牙
@property (nonatomic, strong) UILabel *titleLabel;
/// 显示具体解决方式的标签，ex: 请打开蓝牙，以便正常使用
@property (nonatomic, strong) UILabel *subtitleLabel;
/// 处理按钮，ex: 开启蓝牙
@property (nonatomic, strong) UIButton *handerButton;
/// 代理对象
@property (nonatomic, weak, nullable) id<QDMetroErrorHeaderViewDelegate> delegate;

/// 根据type更新视图
- (void)updateHeaderViewWithType:(QDMetroHeaderErrorType)errorType;

@end

NS_ASSUME_NONNULL_END
